// eslint-disable-next-line
import React from 'react';
import axios from '../../utils/http';
export default Wrappencompoment => {
  return class Input extends React.Component {
    constructor() {
      super();
      this.state = {
        val: '',
        iszeng: 'zengjia',
        nick: '',
        phone: '',
      };
    }
    static displayName = `Form-${getstaticname(Wrappencompoment)}`; //给组件命名
    change = func => {
      return e => {
        func.getall.account.reson = e.target.value;
        func.getall.changeAccount(func.getall.account); //调用mobx里面的函数
        this.setState({
          val: e.target.value,
        });
      };
    };
    thischange = str => {
      return e => {
        if (str === 1) {
          this.setState({
            nick: e.target.value,
          });
        } else {
          console.log(88);
          this.setState({
            phone: e.target.value,
          });
        }
      };
    };
    handleChange = value => {
      // console.log(`${value}`);
      this.setState({
        iszeng: value,
      });
    };
    render() {
      let method = {
        getvalue: this.change,
        handleChange: this.handleChange,
        getnick: this.thischange,
      };
      return (
        <div>
          <Wrappencompoment {...method} {...this.state}></Wrappencompoment>
        </div>
      );
    }
  };
};
function getstaticname(Wrappencompoment) {
  return Wrappencompoment.displayName || Wrappencompoment.name || 'HOC';
}
